<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // 1.创建XMLHttpRequest对象
    const xhr = new XMLHttpRequest();

    // 2.监听状态的改变(宏任务)
    xhr.onreadystatechange = function () {
      if (xhr.readyState !== XMLHttpRequest.DONE) return
      // 将字符串转成JSON对象
      const resJSON = JSON.parse(xhr.response)
      const banners = resJSON.data.banner
      console.log(banners.list)
    }

    // 3.配置请求open
    // method:请求方式
    // url:请求地址
    xhr.open('get', 'http://123.207.32.32:8000/home/multidata')

    // 4.发送请求
    xhr.send()

  </script>
</body>

</html>